import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useAuthStore = defineStore('counter', () => {
  const token = ref('')
  const user = ref(null)
  const rolename = ref('')
  const auths = ref([])
  function getinfo(data: any) {
    token.value = data.token
    user.value = data.user
    rolename.value = data.rolename
    auths.value = data.auths
  }

  return { token, user, rolename, auths, getinfo }
},
  {
    persist: true,
  })
